<template>
  <div class="section">
    <a-radio-group v-model="type" style="margin-bottom: 24px">
      <a-radio-button value="record" v-if="$auth('PERSON.FEE_APPLY')">{{ $t('all.autotext268') }}</a-radio-button>
      <a-radio-button value="contract" v-if="$auth('PERSON.RESEARCH_CONTRACT')">{{ $t('all.autotext1344') }}</a-radio-button>
    </a-radio-group>
    <RecordIndex v-if="type==='record'"/>
    <ContractIndex v-if="type==='contract'"/>
  </div>
</template>

<script>
import RecordIndex from './record/index'
import ContractIndex from './contract/index'
export default {
  name: 'entrance-index',
  components: { RecordIndex, ContractIndex },
  data () {
    return {
      type: ''
    }
  },
  created () {
    this.setInitType()
  },
  methods: {
    setInitType () {
      this.type = this.$auth('PERSON.FEE_APPLY')
        ? 'record'
        : this.$auth('PERSON.RESEARCH_CONTRACT')
          ? 'contract'
          : ''
    }
  }
}
</script>

<style scoped>
  .section {
    border-radius: 8px;
    background-color: #fff;
    padding: 32px 20px;
  }
</style>
